<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="news.util.PageBean" %>
<%--
  Created by IntelliJ IDEA.
  User: 19373
  Date: 2022/3/1
  Time: 11:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>分页界面</title>
    <style>
        @import url("../css/news_content.css");
        @import url("../css/commontopic.css");
    </style>
</head>
<body>
<%@include file="../common/headertopic.jsp" %>
<div class="center" style="height: 460px">
    <%@include file="../common/leftmenutopic.jsp" %>
    <div style="width: 86%">
        <%
            PageBean pageBean = (PageBean) request.getAttribute("pageInfo");
        %>
        <form method="post" action="<%=request.getContextPath()%>/selPublish">
            <table>
                <tr class="one_tr">
                    <th>主题</th>
                    <th>标题</th>
                    <th>摘要</th>
                    <th>作者</th>
                    <th>发布时间</th>
                </tr>
                <%
                    for (int i = 0; i < pageBean.getObjectList().size(); i++) {
                %>
                <tr class="content_tr">
                    <th>
                        <%=pageBean.getObjectList().get(i).getTheme()%>
                    </th>
                    <th>
                        <%=pageBean.getObjectList().get(i).getTitle()%>
                    </th>
                    <th>
                        <%=pageBean.getObjectList().get(i).getDigest()%>
                    </th>
                    <th>
                        <%=pageBean.getObjectList().get(i).getUsername()%>
                    </th>
                    <th>
                        <%=pageBean.getObjectList().get(i).getCreatetime()%>
                    </th>
                    <th><a href="">编辑</a></th>
                    <th>
                        <a href="">删除</a>
                    </th>
                </tr>
                <%
                    }
                %>
            </table>
            <ul id="news_cen_info"
                style="margin-left: 10px;list-style: none;font-size: 15px; display: flex;flex-wrap: nowrap">
                <li><a href="<%=request.getContextPath()%>/selPublish?pageIndex=1">首页</a></li>
                <li>
                    <a href="<%=request.getContextPath()%>/selPublish?pageIndex=<%=pageBean.getCurrPageNo()-1%>">上一页</a>
                </li>
                <li>
                    <a href="<%=request.getContextPath()%>/selPublish?pageIndex=<%=pageBean.getCurrPageNo()+1%>">下一页</a>
                </li>
                <li>
                    <a href="<%=request.getContextPath()%>/selPublish?pageIndex=<%=pageBean.getTotalPageCount()%>">尾页</a>
                </li>
                <li>第<%=pageBean.getCurrPageNo()%>页
                </li>
                <li>共<%=pageBean.getTotalCount()%>页
                </li>
                <li>每页<%=pageBean.getPageSize()%>条数据
                </li>
            </ul>
        </form>
    </div>
</div>
<%@include file="../common/footertopic.jsp" %>
</body>
</html>
